package imgsei.wcj.com.commonbusiness;

import android.app.Application;
import android.content.Context;

import com.alibaba.android.arouter.launcher.ARouter;

import imgsei.wcj.com.commonbusiness.utils.LogUtils;
import imgsei.wcj.com.commonbusiness.utils.UiUtils;

public class BaseApplication extends Application {
    private static final String TAG = "BaseApplication";
    public static BaseApplication instance;
    @Override
    public void onCreate() {
        super.onCreate();
        LogUtils.showLogE(TAG,"INIT START");
        instance = this;
        initARouter(this);
        LogUtils.showLogE(TAG,"INIT END");
    }

    public static Context getInstance() {
        return instance;
    }

    private void initARouter(BaseApplication baseApplication){
        if (UiUtils.isDebug(instance)){
            ARouter.openLog();
            ARouter.openDebug();
        }
        ARouter.init(baseApplication);
    }
}
